﻿@{
    ViewBag.Title = "铝锭牌号标准明细";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts{
        <script src="~/Areas/Qms/ViewModels/qms.com.js"></script>
        <script src="~/Areas/Qms/ViewModels/qms.viewModel.edit.js"></script>
        <script type="text/javascript">
            using(['numberbox','lookup']);
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            ko.bindingViewModel(new viewModel(data));

            function viewModel(data) {
                qms.viewModel.edit.apply(this, arguments);
                //grid高度
                this.grid.size={w:6,h:151};
//                this.grid.OnBeforeDestroyEditor = function(editors,row){
//                    row['UseUnitName'] = editors['UseUnit'].target.lookup('getText');
//                };
            };
        </script>
}

    <div class="z-toolbar">
        <a id="a_save" href="#" plain="true" class="easyui-linkbutton" icon="icon-save" data-bind="click:saveClick,linkbuttonDisable:readonly" title="保存">保存</a>
        <a id="a_undo" href="#" plain="true" class="easyui-linkbutton" icon="icon-undo" data-bind="click:rejectClick,linkbuttonDisable:readonly" title="撤消">撤消</a>
        <a id="a_audit" href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick,easyuiLinkbutton:approveButton" title="审核">审核</a>
       @* <a id="a_printer" href="#" plain="true" class="easyui-linkbutton" icon="icon-printer" title="打印" data-bind="click:printClick">打印</a>*@
        <div class="datagrid-btn-separator"></div>
        <a id="a_first" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_first" data-bind="click:firstClick,linkbuttonEnable:scrollKeys.firstEnable" title="第一条"></a> 
        <a id="a_previous" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_previous" data-bind="click:previousClick,linkbuttonEnable:scrollKeys.previousEnable" title="上一条"></a> 
        <a id="a_next" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_next" data-bind="click:nextClick,linkbuttonEnable:scrollKeys.nextEnable" title="下一条"></a> 
        <a id="a_last" href="#" plain="true" class="easyui-linkbutton" icon="icon-resultset_last" data-bind="click:lastClick,linkbuttonEnable:scrollKeys.lastEnable" title="最后一条"></a> 
    </div>

    <div id="master" class="container_12" data-bind="inputwidth:0.9">
        <div class="grid_1 lbl">单据编号</div>
        <div class="grid_3 val"><input type="text" id="Ldphbz_BillNo" name="Ldphbz_BillNo"  data-bind="value:form.Ldphbz_BillNo,readOnly:true" class="z-txt readonly"/></div>
        <div class="grid_1 lbl">报告日期</div>
        <div class="grid_3 val"><input type="text" id="Ldphbz_BillDate" name="Ldphbz_BillDate" data-bind="dateboxValue:form.Ldphbz_BillDate,dateboxReadOnly:readonly" class="z-txt easyui-datebox" /></div>
        <div class="grid_1 lbl required">送检单位</div>
        <div class="grid_3 val"><input type="text"  data-bind="lookupValue:form.Ldphbz_Bmbh,lookupReadOnly:readonly" required="true" class="z-txt easyui-lookup" data-options="lookupType:'organize',parentField:'pid',multiple:false"/></div>
               
        <div class="clear"></div>
        

        <div class="grid_1 lbl">检验方法 </div>
        <div class="grid_3 val required"><input type="text" data-bind="value:form.Ldphbz_Jyff,readOnly:readonly" class="z-txt"  /></div>
        <div class="grid_1 lbl">判定依据 </div>
        <div class="grid_3 val required"><input type="text" data-bind="value:form.Ldphbz_Pdyj,readOnly:readonly" class="z-txt"  /></div>
        <div class="grid_1 lbl">报告编号 </div>
        <div class="grid_3 val required"><input type="text" data-bind="value:form.Ldphbz_Bgbh,readOnly:readonly" required="true" class="z-txt"  /></div>
        <div class="clear"></div>

        <div class="grid_1 lbl">说明 </div>
        <div class="grid_11 val required"><input type="text" data-bind="value:form.Ldphbz_Remark,readOnly:readonly" class="z-txt"  /></div>
        <div class="clear"></div>
    </div>
  
    <div id="tt" class="easyui-tabs">  
        <div title="表单明细">
            <table id="list" data-bind="datagrid:grid">
                <thead>
                    <tr>
                        <th field="LdphbzDetail_BillNo" hidden="true"></th>  
                        <th field="LdphbzDetail_RowId"  hidden="true" ></th> 
                        <th field="LdphbzDetail_Sybh"  rowspan="2"   editor="{type:'validatebox',options:{required: true }}" sortable="false" align="left"    width="100">试样编号   </th>  
                        <th colspan="7">化学成分（质量分数）/%</th>
                        <th field="LdphbzDetail_Al"  rowspan="2"  editor="{type:'numberbox',options:{max:99,precision:2}}" sortable="false" align="left"    width="80">AL   </th>  
                        <th field="LdphbzDetail_Zzzh"  rowspan="2"  editor="{type:'numberbox',options:{max:99,precision:2}}" sortable="false" align="left"    width="80">杂质总和   </th>  
                        <th field="LdphbzDetail_Ph"  rowspan="2" editor="{type:'validatebox',options:{required: true }}" sortable="false" align="left"    width="120">牌号   </th>  
                        <th field="LdphbzDetail_Remark"  rowspan="2"  editor="text" sortable="false" align="left"    width="100">备注   </th>  
                         
                    </tr>
                   <tr>
                        <th field="LdphbzDetail_Si"  rowspan="2"  editor="{type:'numberbox',options:{max:99,precision:2}}"   sortable="false" align="right"   width="80">硅       </th>
                        <th field="LdphbzDetail_Fe"  rowspan="2"   editor="{type:'numberbox',options:{max:99,precision:2}}"  sortable="false" align="right"   width="80">铁       </th>  
                        <th field="LdphbzDetail_Cu"  rowspan="2"   editor="{type:'numberbox',options:{max:99,precision:2}}"  sortable="false" align="right"   width="80">铜       </th>
                        <th field="LdphbzDetail_Ca"  rowspan="2"    editor="{type:'numberbox',options:{max:99,precision:2}}" sortable="false" align="right"   width="80">钙       </th>  
                        <th field="LdphbzDetail_Mg"  rowspan="2"   editor="{type:'numberbox',options:{max:99,precision:2}}"  sortable="false" align="right"   width="80">镁       </th>
                        <th field="LdphbzDetail_Zn"  rowspan="2"  editor="{type:'numberbox',options:{max:99,precision:2}}"   sortable="false" align="right"   width="80">锌       </th>  
                        <th field="LdphbzDetail_V"  rowspan="2"   editor="{type:'numberbox',options:{max:99,precision:2}}"  sortable="false" align="right"   width="80">V(其他)       </th>
                   </tr>
                </thead>
            </table>  
            
            <div id="gridtb">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" data-bind="click:addRowClick,linkbuttonDisable:readonly">增加明细</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" data-bind="click:removeRowClick,linkbuttonDisable:readonly">删除明细</a>
            </div>  
        </div>
        <div title="表单信息" class="hide" style="padding-top:2px;">
            <div class="container_12" id="BillDetail" data-bind="inputwidth:0.9,autoheight:181"> 
                <div class="clear"></div>
                <div class="grid_1 lbl">审批状态</div>
                <div class="grid_3 val"><input type="text" id="ApproveState" data-bind="value:form.ApproveState,readOnly:true" class="z-txt readonly"/></div>
                <div class="grid_1 lbl">审批意见</div>
                <div class="grid_3 val"><input type="text" id="ApproveRemark" data-bind="value:form.ApproveRemark,readOnly:true"  class="z-txt readonly"/></div>
                <div class="grid_1 lbl">审批人 </div>
                <div class="grid_3 val"><input type="text" id="ApprovePerson"data-bind="value:form.ApprovePerson,readOnly:true" class="z-txt readonly"/></div>

                <div class="clear"></div>
                <div class="grid_1 lbl">审批日期</div>
                <div class="grid_3 val"><input type="text" id="ApproveDate" data-bind="dateboxValue:form.ApproveDate,dateboxReadOnly:true"  class="z-txt easyui-datebox readonly"/></div>
                <div class="grid_1 lbl">编制日期</div>
                <div class="grid_3 val"><input type="text" id="CreateDate" data-bind="dateboxValue:form.CreateDate,dateboxReadOnly:true" class="z-txt easyui-datebox readonly" /></div>
                <div class="grid_1 lbl">编制人</div>
                <div class="grid_3 val "><input type="text" id="CreatePerson" data-bind="value:form.CreatePerson,readOnly:true" class="z-txt readonly" /></div>
                
                <div class="clear"></div>
                <div class="grid_1 lbl">修改日期</div>
                <div class="grid_3 val"><input type="text" id="UpdateDate" data-bind="dateboxValue:form.UpdateDate,dateboxReadOnly:true" class="z-txt easyui-datebox readonly" /></div>
                <div class="grid_1 lbl">修改人</div>
                <div class="grid_3 val "><input type="text" id="UpdatePerson" data-bind="value:form.UpdatePerson,readOnly:true" class="z-txt readonly" /></div>
            </div>
        </div> 
    </div>  

